package cn.changeforyou.web.plugin.page.config;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @author zhyu
 * @date 2021/2/26 15:42
 */
public class FindMybatisPlusCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        try {
            Class.forName("com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration");
        } catch (ClassNotFoundException e) {
            return false;
        }
        return true;
    }
}
